import React from 'react';
import {Layout} from 'antd';
import LayoutHome from './LayoutHome';
import {Header, Sider} from './components';

import './LayoutView.scss';

/**
 * 公共组件布局
 */
export default class LayoutView extends LayoutHome {
  //界面渲染函数
  render() {
    //Layout对IE9的兼容性不好，使用要慎重
    return (
      <div className="g-layout-view">
        <Header />
        <Layout>
          {this.renderSider()}
          {this.renderContent()}
        </Layout>
      </div>
    );
  }

  /**
   * 侧边栏
   */
  renderSider() {
    return <Sider type={this.props.type} />;
  }

  /**
   * 主体
   */
  renderContent() {
    //主体内容
    return (
      <Layout.Content className="content">
        <div className="content-route"> {this.renderRoutes()}</div>
      </Layout.Content>
    );
  }
}
